
#ifndef UCDB_DBUNDERLAYDEF_H
#define UCDB_DBUNDERLAYDEF_H

#pragma once

#include "zdbmain.h"
#include "zacstring.h"

#pragma pack (push, 8)

class UcDbUnderlayItem;
class UcDbUnderlayHost;

class ZSOFT_NO_VTABLE UcDbUnderlayDefinition: public UcDbObject
{
public:
    UCDB_DECLARE_MEMBERS(UcDbUnderlayDefinition);

    UcDbUnderlayDefinition();

    virtual ~UcDbUnderlayDefinition() = 0;
    Ucad::ErrorStatus setSourceFileName(const ZTCHAR* file);
    const ZTCHAR* getSourceFileName() const;
    Ucad::ErrorStatus getActiveFileName(const ZTCHAR*& file) const;
    Ucad::ErrorStatus getActiveFileName(UcString& file) const;
    Ucad::ErrorStatus setItemName(const ZTCHAR* item);
    const ZTCHAR* getItemName() const;
    Ucad::ErrorStatus setUnderlayItem(const ZTCHAR* sourceFileName, const ZTCHAR* activeFileName, UcDbUnderlayItem* pItem);
    const UcDbUnderlayItem* getUnderlayItem() const;
    Ucad::ErrorStatus load(const wchar_t* password);
    void unload();
    bool isLoaded() const;
    static UcString dictionaryKey(const UcRxClass* underlayDefinitionType);
private:
    virtual const UcDbUnderlayHost* getUnderlayHost() const = 0;
};

class UcDbDwfDefinition: public UcDbUnderlayDefinition
{
public:
    UCDB_DECLARE_MEMBERS(UcDbDwfDefinition);

    UcDbDwfDefinition();

    virtual ~UcDbDwfDefinition();
private:
    virtual  const UcDbUnderlayHost* getUnderlayHost() const;
};

class UcDbDgnDefinition: public UcDbUnderlayDefinition
{
public:
    UCDB_DECLARE_MEMBERS(UcDbDgnDefinition);

    UcDbDgnDefinition();

    virtual ~UcDbDgnDefinition();
    bool useMasterUnits() const;
    void setUseMasterUnits(bool useMaster);
    int xrefDepth() const;
    void setXrefDepth(int depth);
    bool showRasterRef() const;
    void setShowRasterRef(bool bShow);
private:
    virtual const UcDbUnderlayHost* getUnderlayHost() const;

};

class UcDbPdfDefinition: public UcDbUnderlayDefinition
{
public:
    UCDB_DECLARE_MEMBERS(UcDbPdfDefinition);

	UcDbPdfDefinition();

	virtual ~UcDbPdfDefinition();
private:
    virtual  const UcDbUnderlayHost* getUnderlayHost() const;
};

#pragma pack (pop)

#endif
